package org.study.bookmanager.repo;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import org.study.bookmanager.entity.Books;
import org.study.bookmanager.entity.Borrows;
import org.study.bookmanager.entity.Reservation;
import org.study.bookmanager.entity.Users;

import java.util.List;


@Repository
public interface ReservationRespository extends JpaRepository<Reservation, Integer>, JpaSpecificationExecutor<Reservation> {
    List<Reservation> findByBookAndFinishFalseOrderByReservedDateAsc(Books books);
    boolean existsReservationByUserAndFinishIsFalseAndReservationID(Users users,int reservationId);
}
